<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('已领取优惠券列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="coupon-lwFoot-form">
                <input name="couponId" th:value="${couponId}" type="hidden">
                <div class="select-list">
                    <ul>
                    </ul>
                </div>
            </form>
        </div>
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="closeItem()">
                <i class="fa fa-reply-all"></i> 关闭
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var datas = [[${@dict.getType('is_enable')}]];
    var prefix = ctx + "back/coupon";

    $(function () {
        var options = {
            url: prefix + "/getList",
            modalName: "已领取优惠券",
            columns: [
                {
                    field: 'memberId',
                    title: '会员ID',
                },
                {
                    field: 'username',
                    title: '会员用户名',
                },
                {
                    field: 'phone',
                    title: '会员手机号',
                },
                {
                    field: 'isUse',
                    title: '是否已使用',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(datas, value);
                    }
                },
                {
                    field: 'isExpired',
                    title: '是否已过期',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(datas, value);
                    }
                },
                {
                    field: 'isEnable',
                    title: '是否有效',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(datas, value);
                    }
                },
                {
                    field: 'createTime',
                    title: '领取时间',
                    sortable: true
                },
                {
                    title: '操作',
                    formatter: function (value, row, index) {
                        var actions = [];
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>